﻿
@{
    ViewBag.Title = "DataInfo";
    Layout = "~/Areas/AdminInfo/Views/Shared/_LayoutPage1.cshtml";
}

@model Gtkj.CMS.Model.AdminInfo
<form action="#" method="get" class="layui-form" style="margin-top:30px">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input class="box_in layui-input" type="text" value="@(Model==null?"":Model.AdminName)" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">旧密码</label>

        <div class="layui-input-block">
            <input type="password" name="Password" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">新密码</label>
        <div class="layui-input-block">
            <input class="layui-input" type="password" name="newPassword">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认新密码</label>
        <div class="layui-input-block">
            <input class="layui-input" type="password" name="newPassword1">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="sub">立即提交</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'layedit', 'element', 'laydate', 'upload'], function () {
        var $ = layui.jquery
        , element = layui.element();
        var form = layui.form(),
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;
        form.on('submit(sub)', function (data) {
            $.post('/AdminMain/PawssworUp', data.field, function (r) {
                if (r.success) {
                    layer.alert("修改成功请重新登录");
                    window.parent.location.href = "/login/Index";
                } else {
                    layer.msg(r.message, { icon: 2 });
                }
            });
            return false;
        });
    });



</script>


